import java.util.*;

public class Main {
    public static void main(String args[]){
        System.out.println("######################################");
        System.out.println("###                                ###");
        System.out.println("###         排序算法示例             ###");
        System.out.println("###                                ###");
        System.out.println("######################################");

        //定义一个列表容器，获取 LinkedList 对象
        List<Employee> staff  = new LinkedList<>();

        staff.add(new Employee("张三丰",5000000,1630,4,1));
        staff.add(new Employee("王重阳",2000000,790,4,1));
        staff.add(new Employee("李世民",9999999999.0,680,4,1));

        System.out.println("排序前：");
        System.out.println(staff);
        staff.sort(Comparator.comparingDouble(Employee::getSalary).reversed());
        System.out.println("排序后：");
        System.out.println(staff);

        List<String> staff1 = new LinkedList<>();
        staff1.add("张三丰");
        staff1.add("王重阳");
        staff1.add("李世民");

        System.out.println("排序前：");
        System.out.println(staff1);

        Collections.sort(staff1);
        System.out.println("排序后：");
        System.out.println(staff1);

        Map<String, Employee> staff2 = new HashMap<>();

        //向映射集合中添加新项
        staff2.put("01",new Employee("张三疯",1,1,1,1));
        staff2.put("02",new Employee("张无忌",1,1,1,1));
        staff2.put("03",new Employee("谢逊",1,1,1,1));
        staff2.put("04",new Employee("灭绝",1,1,1,1));



    }
}
